<%@ page import="java.util.List" %>
<%@ page import="top.liuzhenyu.study.javawebjdbc.entity.TbComputer" %>
<%@ page import="top.liuzhenyu.study.javawebjdbc.dao.TbComputerDAO" %><%--
  Created by IntelliJ IDEA.
  User: liuzhenyu
  Date: 2024/6/3
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<link rel="stylesheet" href="../lib/bootstarp.min.css">
<body>
<%
    List<TbComputer> list = TbComputerDAO.query();
%>

<div style="padding: 1rem;">

    <div>
        <a class="btn btn-primary" href="insert.jsp">发布电脑信息</a>
    </div>

    <div>电脑列表</div>

<table class="table table-hover table-striped table-bordered">

    <thead>
        <tr class="text-bg-primary">
            <th>编号</th>
            <th>电脑厂商</th>
            <th>电脑简介</th>
            <th>电脑价格</th>
            <th>操作</th>
        </tr>
    </thead>

    <tbody>
        <%
            for (TbComputer computer : list) {
        %>

        <tr>
            <td><%=computer.getId()%></td>
            <td><%=computer.getChangshang()%></td>
            <td><%=computer.getDnjj()%></td>
            <td><%=computer.getPrice()%></td>
            <td>
                <a class="btn btn-danger btn-sm" href="delete.jsp?id=<%=computer.getId()%>">删除</a>
            </td>
        </tr>
        <%
            }
        %>

    </tbody>
</table>


</div>
    <script src="../lib/bootstarp.min.js"></script>
</body>
</html>
